﻿// This source file is part of WallpaperControl, a tool for automatic changing 
// of the desktop wallpaper.
// 
// Visit http://wpcontrol.sourceforge.net/ for more.
//
// Copyright (c) 2014 nscrolldev
//
// Licensed under the GPLv2.
// See http://www.gnu.org/licenses/gpl-2.0.html for details.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WallpaperControl
{
    /// <summary>
    /// Defines what methods and properties a condition must implement.
    /// </summary>
    internal abstract class Condition
    {
        /// <summary>
        /// The ID of the condition.
        /// </summary>
        internal abstract int Id
        {
            get;
        }

        /// <summary>
        /// Gets the remaining time until the next wallpaper change.
        /// </summary>
        internal abstract TimeSpan RemainingTime
        {
            get;
        }

        /// <summary>
        /// Gets the additional value set for the condition.
        /// </summary>
        internal abstract object Value
        {
            get;
            set;
        }

        /// <summary>
        /// Checks if the current condition is true and executes the wallpaper 
        /// change.
        /// </summary>
        internal abstract void Check();

        /// <summary>
        /// Called when the user changes the wallpaper manually in a running session.
        /// </summary>
        internal abstract void ManualChangeCallback();

        /// <summary>
        /// Called when the session is stopped.
        /// </summary>
        internal abstract void StopSession();

        /// <summary>
        /// Apply a new value to the condition. Called when the user changes the 
        /// value, e.g. by changing the time.
        /// </summary>
        internal abstract void ApplyValue();
    }
}
